﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using cbmobile.BLC;
using cbmobile.DAC;
using System.Data;
using System.Data.SqlClient;
using PQT.API;


namespace cbmobile.MasterUser.UC_Page
{
    public partial class ShowLinhKien : System.Web.UI.UserControl
    {
        BLC_LinhKien nBLC = new BLC_LinhKien();
        protected void Page_Load(object sender, EventArgs e)
        {
            BinInfo();
        }

        protected void BinInfo()
        {
            if (Request.QueryString["TenLoaiLK"] != null)
            {
                LoaiLinhKien ent = nBLC.Get_LK_By_NameLK(this.TenLK);
                DL_AccList.DataSource = nBLC.Get_LK_By_IDMaLK(ent.Ma_LoaiLinhKien);
                DL_AccList.DataBind();
            }
            else
            {
                DL_AccList.DataSource = nBLC.Get_LK_Top();
                DL_AccList.DataBind();
            }
        }

        protected string TenLK
        {
            get
            {
                if (Request.QueryString["TenLoaiLK"] != null)
                    return Request.QueryString["TenLoaiLK"].ToString();
                return null;
            }
        }
        protected string GetImagePath(object p_fileID)
        {
            string path = "/ImagesLK/" + Convert.ToString(p_fileID);
            return path;
        }
    }
}